//
//  ActivitySeatHeaderView.m
//  ZiJinLian
//
//  Created by 震霄 张 on 2018/4/5.
//  Copyright © 2018年 lzy. All rights reserved.
//

#import "ActivitySeatHeaderView.h"

@interface ActivitySeatHeaderView()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leftDistance;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *rightDistance;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end

@implementation ActivitySeatHeaderView

+(instancetype)activitySeatHeaderView
{
	return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;

}
-(void)awakeFromNib
{
	[super awakeFromNib];
	self.autoresizingMask = UIViewAutoresizingNone;
	CGFloat distance = (screen_Width - 3 * 45)/4;
	self.leftDistance.constant = distance;
	self.rightDistance.constant = distance;
}

-(void)setModel:(ActivityChoosePosModel *)model
{
	_model = model;
	self.nameLabel.text = model.wallName;
	NSMutableString *tmpStr = [NSMutableString string];
	for (int i = 0; i<model.specialPrices.count; i++) {
		NSNumber *price =model.specialPrices[i];
		[tmpStr appendString:price.stringValue];
		if (i != model.specialPrices.count-1) {
			[tmpStr appendString:@" "];
		}
	}
	self.priceLabel.text = tmpStr;
}
@end
